package mother_merge;

/**
 * Created by xupeng20 on 2019/1/30.
 */
public class Java_Mother_GetMaxNum {
    //这里注意复习 java四大权限
    public static int getMaxNum(int[] arr,int L,int R){
        if (L==R||arr.length<2){
            return arr[L];
        }
        int mid = L+(R-L)/2;
        int leftMaxNum = getMaxNum(arr, L, mid);
        int rightMaxNum = getMaxNum(arr, mid+1, R);
        int max = Math.max(leftMaxNum, rightMaxNum);
        return max;
    }
    public static void main(String[] args){
        int[] arr ={1,4,3,4,56,6};
        int maxNum = getMaxNum(arr, 0, arr.length-1 );
        System.out.println(maxNum);
    }
}
